import io.etcd.jetcd.Client;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.functions.source.RichParallelSourceFunction;

public class mySourceFun extends RichParallelSourceFunction<String> {
    private Client etclClient = null;
    private boolean running = true;

    @Override
    public void open(Configuration parameters) throws Exception {
        etclClient = ETCD.getEtclClient();
    }


    @Override
    public void run(SourceContext<String> ctx) throws Exception {
        ETCD.initListen(etclClient, "key11", ctx);
        while (running) {

        }

    }

    @Override
    public void cancel() {
        running = false;
    }
}